package com.itwn.portal.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itwn.common.constant.RedisConst;
import com.itwn.portal.model.entity.BookType;
import com.itwn.portal.service.BookTypeService;
import com.itwn.portal.mapper.BookTypeMapper;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 61073
* @description 针对表【t_book_type】的数据库操作Service实现
* @createDate 2024-12-06 15:48:42
*/
@Service
public class BookTypeServiceImpl extends ServiceImpl<BookTypeMapper, BookType>
    implements BookTypeService{

    /**
     * 使用@Cacheable缓存注解，自动缓存类别； 并且缓存的key使用自定义缓存策略
     * key 指定容器中的key生成策略的bean的名称
     * @return
     */
    @Cacheable(cacheNames = RedisConst.BOOK_TYPE_LIST,keyGenerator = "keyGenerator")
    @Override
    public List<BookType> findAll() {
        return list();
    }
}




